package net.sxjr.protal.user;

import net.sxjr.common.Response;
import net.sxjr.protal.user.service.LearningManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：cuixc
 * @date ：Created in 2020/12/11 14:11
 * @description：我要学习模块
 * @modified By：
 */
@RestController
@RequestMapping("/learning")
public class LearningManageController {
    @Autowired
    private LearningManageService learningManageService;
    @GetMapping("/list")
    public Response list(@RequestParam(required = false) String contentType,
                         @RequestParam(value = "size", defaultValue = "5") Integer size,
                         @RequestParam(value = "current", defaultValue = "1") Integer current){
        return learningManageService.list(contentType,size,current);
    }

    @GetMapping("/content")
    public Response content(@RequestParam String learningId){
        return learningManageService.content(learningId);
    }
}
